/* TableDemo2.java 
* Created on Dec 19, 2012 
* Author:Mr.Viet
* Phone: 01683430426
* Email: phamvanvietcdhd@gmail.com
*/ 
package com.session5; 

import java.util.Vector;

import javax.swing.JScrollPane;
import javax.swing.JTable;

public class TableDemo2 extends AbstracFrame {
	private JTable tblStudent;
	private Vector<String> columns;
	private Vector<Vector<String>> data;
	public TableDemo2() {
		this.columns = new Vector<String>();
		this.columns.add("Std Name");
		this.columns.add("Address");
		this.columns.add("Age");
		
		this.data = new Vector<Vector<String>>();
		Vector<String> item1 = new Vector<String>();
		item1.addElement("NgocNV");
		item1.addElement("HN");
		item1.addElement("30");
		this.data.add(item1);
		
		Vector<String> item2 = new Vector<String>();
		item2.addElement("NgocNV");
		item2.addElement("HN");
		item2.addElement("30");
		this.data.add(item2);
		
		Vector<String> item3 = new Vector<String>();
		item3.addElement("NgocNV");
		item3.addElement("HN");
		item3.addElement("30");
		this.data.add(item3);
	}
	public static void main(String[] args) {
		TableDemo2 f = new TableDemo2();
		f.createForm();
		f.showForm();
	}
	@Override
	public void createForm() {
		this.tblStudent = new JTable(this.data, this.columns);
		this.getContentPane().add(new JScrollPane(tblStudent));
	}
	
}
